""" 欢迎关注 "码农架构" 微信公众号，热爱开源，拥抱开源。一个IT民工的技术之路经验分享。
    - 问题咨询 / 建议
    1.关注微信公众号 "码农架构" 后私信
    2.可发送邮件: li.shangzhi@aliyun.com
"""
# !/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2019/12/27 23:32
# @Author  : iByte

import os

logdir = os.getenv("logs")
logfile = 'script_list.log'
path = os.getenv("scripts")

logfilename = os.path.join(logdir, logfile)
log = open(logfilename, 'w')

for dirpath, dirname, filenames in os.walk(path):
    for filename in filenames:
        log.write(os.path.join(dirpath, filename) + '\n')

print("\nYour logfile ", logfilename, "has been created")
